C3 S1 Impressions

Row

Raw. Cluster 1

Raw. Cluster 2

Raw. Cluster 3

Raw. Cluster 4

Raw. Cluster 5

Row

Growth. Cluster 1

Growth. Cluster 2

Growth. Cluster 3

Growth. Cluster 4

Growth. Cluster 5

LS S1 Impressions

Row

Raw. Cluster 1

Raw. Cluster 2

Raw. Cluster 3

Row

Growth. Cluster 1

Growth. Cluster 2

Growth. Cluster 3

C3 S1-S2 Impressions

Row

Raw. Cluster 1

Raw. Cluster 2

Raw. Cluster 3

Raw. Cluster 4

Raw. Cluster 5

Row

Growth. Cluster 1

Growth. Cluster 2

Growth. Cluster 3

Growth. Cluster 4

Growth. Cluster 5

LS S1-S2 Impressions

Row

Raw. Cluster 1

Raw. Cluster 2

Raw. Cluster 3

Row

Growth. Cluster 1

Growth. Cluster 2

Growth. Cluster 3

---
title: "CENT S1 Clusters. Raw Impressions. Detail "
output: 
  flexdashboard::flex_dashboard:
    vertical_layout: scroll
    orientation: rows
    source_code: embed
---

```{r}
library(plyr)
library(dplyr)
library(ggplot2)
library(plotly)
library(scales)
```

```{r}
df <- read.csv("CENT_showlevel.csv") %>% select(-X) %>% 
  filter(Episode_num < 15 & Season_num > 0 & Season_num < 3)
lookup <- read.csv("s1_shows_best_clusters.csv")
df$clusters_C3_raw <- lookup$C3_raw_5kmeans[match(df$Show_Name, lookup$Show_Name)]
df$clusters_C3_growth <- lookup$C3_growth_5kmeans[match(df$Show_Name, lookup$Show_Name)]
df$clusters_LS_raw <- lookup$LS_raw_3dtw[match(df$Show_Name, lookup$Show_Name)]
df$clusters_LS_growth<- lookup$LS_growth_5tadpole[match(df$Show_Name, lookup$Show_Name)]
```

```{r}
my_theme <-  theme(panel.background = element_blank(), 
                   panel.grid.major = element_line(color = "#d8d8d8", linetype = "dotted"), 
                   panel.grid.major.x = element_blank(), 
                   plot.title = element_text(hjust = 0.5),
                   axis.title.y = element_blank(),
                   axis.line.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   axis.line.x = element_line(color = "#d8d8d8", linetype = "dashed"),
                   strip.background = element_blank())
```

C3 S1 Impressions
====================

Row {.tabset}
---------------------------------------

### Raw. Cluster 1

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 1, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1 Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 2

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 2, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(ylim = c(0, 1500000)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 3

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 3, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1 Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 4

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 4, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1 Cluster 4",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 5

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 5, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1 Cluster 5",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

Row {.tabset}
---------------------------------------

### Growth. Cluster 1

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 1, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1  Raw Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 2

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 2, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, Raw S1 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 3

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 3, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1 Raw Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 4

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 4, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1 Raw Cluster 4",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 5

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 5, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1 Raw Cluster 5",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```


LS S1 Impressions
====================

Row {.tabset}
---------------------------------------

### Raw. Cluster 1

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 1, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1 Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 2

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 2, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(ylim = c(0, 1500000)) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 3

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 3, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1 Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```



Row {.tabset}
---------------------------------------

### Growth. Cluster 1

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 1, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, S1  Raw Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 2

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 2, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, Raw S1 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 3

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 3, Season_num == 1)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  my_theme

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, S1 Raw Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

C3 S1-S2 Impressions
====================

Row {.tabset}
---------------------------------------

### Raw. Cluster 1

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 1, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1-S2 Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 2

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 2, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1-S2 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 3

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 3, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1-S2 Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 4

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 4, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1-S2 Cluster 4",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 5

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 5, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions, S1-S2 Cluster 5",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

Row {.tabset}
---------------------------------------

### Growth. Cluster 1

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 1, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1-S2  Raw Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 2

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 2, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, Raw S1-S2 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 3

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 3, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1-S2 Raw Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 4

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 4, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1-S2 Raw Cluster 4",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 5

```{r, fig.align = 'center'}
C3_raw <- ggplot(df %>% filter(is.na(clusters_C3_raw) == F, clusters_C3_raw == 5, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = C3_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = C3_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(C3_raw) %>% 
  layout(title = "C3 Impressions Growth, S1-S2 Raw Cluster 5",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

LS S1-S2 Impressions
====================

Row {.tabset}
---------------------------------------

### Raw. Cluster 1

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 1, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1-S2 Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 2

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 2, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(ylim = c(0, 1500000)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1-S2 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Raw. Cluster 3

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 3, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Impressions, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Impressions, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
   scale_y_continuous(labels = comma) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions, S1-S2 Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```



Row {.tabset}
---------------------------------------

### Growth. Cluster 1

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 1, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, S1-S2  Raw Cluster 1",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 2

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 2, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, Raw S1-S2 Cluster 2",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```

### Growth. Cluster 3

```{r, fig.align = 'center'}
LS_raw <- ggplot(df %>% filter(is.na(clusters_LS_raw) == F, clusters_LS_raw == 3, Season_num == 1 | Season_num == 2)) +
  geom_line(aes(x = Episode_num, y = LS_Growth, color = Show_Name)) +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Linear"), 
              color = "black", se = F, method = lm, linetype = "dashed") +
  geom_smooth(aes(x = Episode_num, y = LS_Growth, alpha = "Smooth"), 
              color = "#747677", se = F, linetype = "dotted") +
  labs(x = "Episode Number") +
  scale_y_continuous(labels = comma) +
  coord_cartesian(xlim = c(2, 14)) +
  facet_wrap(~ Season_num) +
  my_theme +
  theme(panel.spacing = unit(-3, "lines"))

ggplotly(LS_raw) %>% 
  layout(title = "LS Impressions Growth, S1-S2 Raw Cluster 3",
         autosize = FALSE, width = 1700, height = 500, 
         margin = list(l = 150, 
                       r = 50, 
                       b = 100, 
                       t = 50))
```